#include <iostream>
#include <cmath>
#include <string>
#include <fstream>
#include <set>
#include <algorithm>
#include <cassert>

bool judge(std::string const & s)
{
	std::string t = s;
	std::reverse(t.begin(), t.end());
	return s == t;
}

int main()
{
	int n, m, k;
	std::string s;
	std::cin >> k;
	std::cin >> n >> m >> k;
	std::set<std::string> all;

	{
		std::ifstream f1("bfdiff.out1");
		f1 >> s;
		if (s == "Impossible") {
			std::cout << "YES\n";
			return 0;
		}
		if ((int)s.size() != n) {
			std::cout << "NO\n";
			return 0;
		}

		int nn = s.size();
		for (int i = 0; i < nn; i++)
			for (int j = 1; i + j - 1 < nn; j++) {
				std::string tmp = s.substr(i, j);
				if (judge(tmp)) all.insert(tmp);
			}
	}
	if ((int)all.size() == m)
		std::cout << "YES\n";
	else
		std::cout << "NO\n";
}

